package org.little.v3;

import org.junit.Test;
import org.little.context.ApplicationContext;
import org.little.context.support.ClassPathXmlApplicationContext;
import org.little.service.v3.PetStoreService;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

/**
 * @author Tinyspot
 * @date 2022-05-22 12:40
 */
public class ApplicationContextTest3 {

    @Test
    public void testGetBeanProperty() {
        ApplicationContext context = new ClassPathXmlApplicationContext("little-v3.xml");
        PetStoreService petStoreService = (PetStoreService) context.getBean("petStore");

        assertNotNull(petStoreService.getAccountDao());
        assertNotNull(petStoreService.getItemDao());
        assertEquals(1, petStoreService.getVersion());
    }
}
